const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = {
  mode: 'development',
  entry: "./src/app.js",
  output: {
    filename: "app.js",
    path: path.resolve(__dirname, "dist"),
  },
  plugins: [
    new CopyWebpackPlugin([
      { from: "./src/*.html", to: "[name].html" },
      { from: "./src/css/*.css", to: "[name].css" },
      { from: "./src/js/*.js", to: "[name].js" },
      { from: "./src/image/*.png", to: "[name].png" },
    ]),
  ],
  devServer: { contentBase: path.join(__dirname, "dist"), compress: true },
};
